package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

class zlx {
   private static String a = "Cell:";
   private static String b = "Comment:";
   private float c;
   private float d;
   private Comment e;
   private Worksheet f;
   private double[] g;
   private float h;
   private float i;
   private float j;
   private float k;
   private int l;
   private int m = 0;
   private float n;
   private float o;
   private com.aspose.cells.a.d.zb p;
   private int q = 0;
   private Font r;
   private float s;
   private float t;
   private float u;
   private float v;
   private float w;
   private float x;
   private float y;
   private com.aspose.cells.a.d.ze z;
   private float A;
   private double[] B;

   zlx(float var1, float var2, Comment var3, Worksheet var4, double[] var5, float var6, float var7, com.aspose.cells.a.d.ze var8, float var9, double[] var10) {
      this.c = var1;
      this.d = var2;
      this.e = var3;
      this.f = var4;
      this.g = var5;
      this.h = var6;
      this.i = var7;
      this.z = var8;
      this.A = var9;
      this.B = var10;
      this.d();
   }

   private void d() {
      this.r = this.f.getWorkbook().getDefaultStyle().getFont();
      this.s = (float)this.f.getWorkbook().getWorksheets().L();
      this.t = (float)this.f.getCells().getStandardHeightPixels();
      this.u = (float)this.f.getCells().getStandardWidthPixels();
      this.v = this.t / this.s * 72.0F * (float)this.g[1];
      this.w = this.u / this.s * 72.0F * (float)this.g[0];
      this.x = this.h / 72.0F * this.s;
      this.y = this.i / 72.0F * this.s;
   }

   com.aspose.cells.a.d.zb a(int var1) throws Exception {
      this.p = new com.aspose.cells.a.d.zb();
      int var2 = 0;
      this.n = 0.0F;
      this.o = 0.0F;
      this.j = this.c;
      this.k = this.d;
      int[] var3;
      com.aspose.cells.a.d.zb var4;
      if (var1 == 0 || var1 == 2) {
         this.l = 8;
         var3 = new int[]{var2};
         var4 = this.a(a, this.w, this.u * (float)this.g[0] + 100.0F, var3);
         var2 = var3[0];
         this.p.a((com.aspose.cells.a.d.zl)var4);
         this.j += this.n;
         String var5 = this.f.getCells().get(this.e.getRow(), this.e.getColumn()).getName();
         this.l = 7;
         var3[0] = var2;
         com.aspose.cells.a.d.zb var6 = this.a(var5, this.h - this.w, this.x - this.u * (float)this.g[0], var3);
         var2 = var3[0];
         this.p.a((com.aspose.cells.a.d.zl)var6);
         if (var1 == 0) {
            return this.p;
         }
      }

      if (var1 == 1 || var1 == 2) {
         this.j = this.c;
         this.k += this.o;
         this.l = 8;
         var3 = new int[]{var2};
         var4 = this.a(b, this.w, this.u * (float)this.g[0] + 100.0F, var3);
         var2 = var3[0];
         this.p.a((com.aspose.cells.a.d.zl)var4);
         this.j += this.n;
         this.l = 7;
         var3[0] = var2;
         com.aspose.cells.a.d.zb var7 = this.a(this.e.getNote(), this.h - this.w, this.x - this.u * (float)this.g[0], var3);
         var2 = var3[0];
         this.p.a((com.aspose.cells.a.d.zl)var7);
         this.q = 1 + var2;
         if (var1 == 1) {
            return this.p;
         }
      }

      return this.p;
   }

   com.aspose.cells.a.d.zb a() throws Exception {
      return this.a(2);
   }

   private com.aspose.cells.a.d.zb a(String var1, float var2, float var3, int[] var4) throws Exception {
      zot var5 = new zot();
      var5.a = var1;
      var5.b = this.r;
      ArrayList var6 = new ArrayList();
      com.aspose.cells.b.a.a.ze.a(var6, (Object)var5);
      this.a(var6);
      zly var7 = new zly(var6, var3, this.t * (float)this.g[1], this.A, this.g, this.l, this.z);
      var4[0] = var7.a();
      this.n = var2;
      this.o = this.v * (float)var7.a();
      com.aspose.cells.a.d.zb var8 = new com.aspose.cells.a.d.zb();
      var7.a(var8);
      com.aspose.cells.b.a.b.zq var9 = this.a(var7.b(), var7.c());
      com.aspose.cells.a.d.zb var10 = new com.aspose.cells.a.d.zb();
      var10.a(new com.aspose.cells.b.a.b.a.zi(1.0F, 0.0F, 0.0F, 1.0F, var9.j(), var9.m()));
      var10.a((com.aspose.cells.a.d.zl)var8);
      return var10;
   }

   private com.aspose.cells.b.a.b.zq a(float var1, float var2) {
      float var3 = 0.0F;
      float var4 = 0.0F;
      switch(this.m) {
      case 0:
         var4 = this.k + this.o - var2 - (float)(1.0D * this.g[1]);
         break;
      default:
         var4 = this.k + this.o - var2 - (float)(1.0D * this.g[1]);
      }

      switch(this.l) {
      case 7:
         var3 = this.j + (float)(1.0D * this.g[0]);
         break;
      case 8:
         var3 = this.j + (this.n - var1 - 1.0F);
         break;
      default:
         var3 = this.j + (float)(1.0D * this.g[0]);
      }

      com.aspose.cells.b.a.b.zq var5 = new com.aspose.cells.b.a.b.zq(var3, var4, var1, var2);
      return var5;
   }

   int b() throws Exception {
      if (this.q <= 0) {
         this.a();
      }

      return this.q;
   }

   int c() throws Exception {
      return this.b() - 1;
   }

   void a(com.aspose.cells.b.a.b.zo var1) {
      this.c = var1.d();
      this.d = var1.e();
   }

   private void a(ArrayList var1) throws Exception {
      boolean var2 = false;
      Iterator var3 = var1.iterator();

      zot var4;
      while(var3.hasNext()) {
         var4 = (zot)var3.next();
         if (!com.aspose.cells.a.d.zfs.a(var4.b.getName(), var4.b.m(), var4.a)) {
            var2 = true;
            break;
         }
      }

      if (var2) {
         zgd.a(var1);
         var3 = var1.iterator();

         while(var3.hasNext()) {
            var4 = (zot)var3.next();
            if (!com.aspose.cells.a.d.zfs.a(var4.b.getName(), var4.b.m(), var4.a)) {
               Font var5 = new Font(this.f.getWorkbook().getWorksheets(), (Object)null, false);
               var5.c(var4.b);
               var5.setDoubleSize(var4.b.getDoubleSize());
               if (var4.a.length() > 0) {
                  com.aspose.cells.a.d.zfq var6 = com.aspose.cells.a.d.zfs.a(var4.b.m(), var4.a.charAt(0));
                  if (var6 != null) {
                     var5.setName(var6.b());
                     var4.b = var5;
                  }
               }
            }
         }
      }

   }
}
